import http from "@/utils/request";
import config from "@/config";

async function viewProcessChart(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/viewProcessChart",data,{});
}

async function flowStart(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/startFlow",data,{});
}

async function listTasks(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/listTasks",data,{});
}
async function listTaskCount(data) {
	return await http.post(config.API_URL+"/console/flowableOutManage/listTaskCount",data,{});
}

async function getById(params) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/getFlowById",params,{});
}

async function getDetail(params) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/getDetail",params,{});
}

async function listMineFlowInsts(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/listMineFlowInsts",data,{});
}

async function listMineFlowInstCcs(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/listMineFlowInstCcs",data,{});
}

async function listMineAuditRecords(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/listMineAuditRecords",data,{});
}

async function listFlowInsts(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/listFlowInsts",data,{});
}

async function getFlowInsts(data) {
	return await http.post(config.API_URL+"/console/flowableOutManage/getFlowInsts",data,{});
}

async function getFlowNodes(data) {
	return await http.post(config.API_URL+"/console/flowableOutManage/getFlowNodes",data,{});
}
async function getFlowNodesAndTaskByFlowInstansId(data) {
	return await http.post(config.API_URL+"/console/flowableOutManage/getFlowNodesAndTaskByFlowInstansId",data,{});
}

async function approve(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/approve",data,{});
}

async function reject(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/reject",data,{});
}

async function transact(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/transact",data,{});
}

async function assign(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/assign",data,{});
}

async function cancel(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/cancel",data,{});
}

async function comment(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/comment",data,{});
}

async function jump(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/jump",data,{});
}

async function addBeforeSign(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/addBeforeSign",data,{});
}

async function addAfterSign(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/addAfterSign",data,{});
}

async function addSign(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/addSign",data,{});
}

async function delSign(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/delSign",data,{});
}

async function restart(data) {
	return await http.post(config.API_URL+"/console/document/reSaveFamsDocument",data,{});
}
async function restartByFlow(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/reStartProcessInstance",data,{});
}

async function reactivate(data) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/reactivate",data,{});
}

async function listJumpableNodes(params) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/listJumpableNodes",params,{});
}

async function listRemoveableNodeAssignees(params) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/listRemoveableNodeAssignees",params,{});
}

async function listAssignAssignees(params) {
	return await http.post(config.API_URL+"/console/flowableButtonManage/listAssignAssignees",params,{});
}
async function listOldFlows(params) {
	return await http.post(config.API_URL+"/console/processDetailManage/findByQueryDTO",params,{});
}

export default {
    viewProcessChart,
    flowStart,
    listTasks,
	listTaskCount,
    getById,
    getDetail,
    approve,
	restart,
	restartByFlow,
    reject,
	reactivate,
    transact,
    assign,
    listMineFlowInsts,
    listMineFlowInstCcs,
    listMineAuditRecords,
    cancel,
    comment,
    listJumpableNodes,
    jump,
    addBeforeSign,
    addAfterSign,
    addSign,
    delSign,
    listRemoveableNodeAssignees,
	listAssignAssignees,
    listFlowInsts,
	getFlowInsts,
	getFlowNodes,
	getFlowNodesAndTaskByFlowInstansId,
	listOldFlows,
};
